//
//  LoadImageOperation.m
//  simple-code-oc
//
//  Created by iGaven on 2023/12/12.
//

#import "LoadImageOperation.h"

@interface LoadImageOperation ()

@property(nonatomic, strong, readwrite) UIImage *image;

@end

@implementation LoadImageOperation

- (void)main {
    self.image = [self imageFromUrl:self.imgUrl];
}

- (UIImage *)imageFromUrl:(NSString *)imgUrl {
    NSURL *url = [NSURL URLWithString:imgUrl];
    NSData *imgData = [NSData dataWithContentsOfURL:url];
    return [UIImage imageWithData:imgData];
}

@end
